<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/js/thirdparty/jquery.js"></script>
    <script src="global.js"></script>
    <style>
        .div-login {
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, .4);
            display: none;
            z-index: -1;
        }

        .div-login.active {
            display: block;
            z-index: 9999;
        }
    </style>
</head>
<body>

    <script>
        $.ajax({
            url: "http://" + baseURL + ":" + basePort + "/logout",
            type:'POST',
            success:function (data) {
                console.log('logout success========================')
                $.ajax({
                    url: "http://" + baseURL + ":" + basePort + "/login.jsp",
                    type: "POST",
                    data:{
                        username:'admin',
                        password:'123'
                    },
                    success:function (data) {
                        console.log('data:',data);
                        if(data.success){
                            window.sessionStorage.setItem('access_token',data.access_token);
                            window.location.href= './index.html';
                        }else{
                            alert('Error');
                        }
                    },
                    error:function (err) {
                        console.log('err:',err)
                    }
                });
            }
        })

    </script>
</body>
</html>
